public class Java20 {
    public static void main(String[] args) {
        //冒泡排序
        int[] g = new int[]{10,30,12,80,100,0,22};
        int min = g[0], max = g[0];
        for (int i = 0; i < g.length; i++) {
            if (g[i] < min) min = g[i];
            if (g[i] > max) max = g[i];
        }
        System.out.println("数组最小值是：" + min);
        System.out.println("数组最大值是：" + max);
        for (int i = 1; i < g.length; i++) {
            for (int j = 0; j < g.length - i; j++) {
                if (g[j] > g[j + 1]) {
                    int temp = g[j];
                    g[j] = g[j + 1];
                    g[j + 1] = temp;
                }
            }

        }
        for (int i = 0; i < g.length; i++) {
            System.out.print(g[i] + ",");
        }
        //数组最值
        int[] c = {2, 1, 18, 7, 8,10,100,60};
        max = c[0];
        for (int i = 1; i < c.length; i++) {
            if (c[i] > max) {
                max = c[i];
            }
        }
        System.out.println("数组c中的最大值为" + max);

    }
}
